package com.education.welco.service.impl;


import com.education.common.utils.Convert;
import com.education.welco.mapper.TGradeMapper;
import com.education.welco.pojo.TGrade;
import com.education.welco.service.ITGradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 年级 服务层实现
 *
 * @author d
 * @date 2020-05-08
 */
@Service
public class TGradeServiceImpl implements ITGradeService {

    @Autowired
    private TGradeMapper tGradeMapper;

    /**
     * 查询年级信息
     *
     * @param id 年级ID
     * @return 年级信息
     */
    @Override
    public TGrade selectTGradeById(Integer id) {
        return tGradeMapper.selectTGradeById(id);
    }

    /**
     * 查询年级列表
     *
     * @param tGrade 年级信息
     * @return 年级集合
     */
    @Override
    public List<TGrade> selectTGradeList(TGrade tGrade) {
        return tGradeMapper.selectTGradeList(tGrade);
    }

    /**
     * 新增年级
     *
     * @param tGrade 年级信息
     * @return 结果
     */
    @Override
    public int insertTGrade(TGrade tGrade) {
        return tGradeMapper.insertTGrade(tGrade);
    }

    /**
     * 修改年级
     *
     * @param tGrade 年级信息
     * @return 结果
     */
    @Override
    public int updateTGrade(TGrade tGrade) {
        return tGradeMapper.updateTGrade(tGrade);
    }

    /**
     * 删除年级对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTGradeByIds(String ids) {
        return tGradeMapper.deleteTGradeByIds(Convert.toStrArray(ids));
    }
}